Optimal. Leaf size=223 \[ \frac {a^4 (92 B+93 i A) \cot ^3(c+d x)}{60 d}-\frac {4 a^4 (A-i B) \cot ^2(c+d x)}{d}-\frac {8 a^4 (B+i A) \cot (c+d x)}{d}-\frac {8 a^4 (A-i B) \log (\sin (c+d x))}{d}+\frac {(13 A-12 i B) \cot ^4(c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{20 d}-8 a^4 x (B+i A)-\frac {(2 B+3 i A) \cot ^5(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{10 d}-\frac {a A \cot ^6(c+d x) (a+i a \tan (c+d x))^3}{6 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.65, antiderivative size = 223, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 5, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.147, Rules used = {3593, 3591, 3529, 3531, 3475} \[ \frac {a^4 (92 B+93 i A) \cot ^3(c+d x)}{60 d}-\frac {4 a^4 (A-i B) \cot ^2(c+d x)}{d}-\frac {8 a^4 (B+i A) \cot (c+d x)}{d}-\frac {8 a^4 (A-i B) \log (\sin (c+d x))}{d}-\frac {(2 B+3 i A) \cot ^5(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{10 d}+\frac {(13 A-12 i B) \cot ^4(c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{20 d}-8 a^4 x (B+i A)-\frac {a A \cot ^6(c+d x) (a+i a \tan (c+d x))^3}{6 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3529
Rule 3531
Rule 3591
Rule 3593
Rubi steps
\begin {align*} \int \cot ^7(c+d x) (a+i a \tan (c+d x))^4 (A+B \tan (c+d x)) \, dx &=-\frac {a A \cot ^6(c+d x) (a+i a \tan (c+d x))^3}{6 d}+\frac {1}{6} \int \cot ^6(c+d x) (a+i a \tan (c+d x))^3 (3 a (3 i A+2 B)-3 a (A-2 i B) \tan (c+d x)) \, dx\\ &=-\frac {a A \cot ^6(c+d x) (a+i a \tan (c+d x))^3}{6 d}-\frac {(3 i A+2 B) \cot ^5(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{10 d}+\frac {1}{30} \int \cot ^5(c+d x) (a+i a \tan (c+d x))^2 \left (-6 a^2 (13 A-12 i B)-6 a^2 (7 i A+8 B) \tan (c+d x)\right ) \, dx\\ &=-\frac {a A \cot ^6(c+d x) (a+i a \tan (c+d x))^3}{6 d}-\frac {(3 i A+2 B) \cot ^5(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{10 d}+\frac {(13 A-12 i B) \cot ^4(c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{20 d}+\frac {1}{120} \int \cot ^4(c+d x) (a+i a \tan (c+d x)) \left (-6 a^3 (93 i A+92 B)+6 a^3 (67 A-68 i B) \tan (c+d x)\right ) \, dx\\ &=\frac {a^4 (93 i A+92 B) \cot ^3(c+d x)}{60 d}-\frac {a A \cot ^6(c+d x) (a+i a \tan (c+d x))^3}{6 d}-\frac {(3 i A+2 B) \cot ^5(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{10 d}+\frac {(13 A-12 i B) \cot ^4(c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{20 d}+\frac {1}{120} \int \cot ^3(c+d x) \left (960 a^4 (A-i B)+960 a^4 (i A+B) \tan (c+d x)\right ) \, dx\\ &=-\frac {4 a^4 (A-i B) \cot ^2(c+d x)}{d}+\frac {a^4 (93 i A+92 B) \cot ^3(c+d x)}{60 d}-\frac {a A \cot ^6(c+d x) (a+i a \tan (c+d x))^3}{6 d}-\frac {(3 i A+2 B) \cot ^5(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{10 d}+\frac {(13 A-12 i B) \cot ^4(c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{20 d}+\frac {1}{120} \int \cot ^2(c+d x) \left (960 a^4 (i A+B)-960 a^4 (A-i B) \tan (c+d x)\right ) \, dx\\ &=-\frac {8 a^4 (i A+B) \cot (c+d x)}{d}-\frac {4 a^4 (A-i B) \cot ^2(c+d x)}{d}+\frac {a^4 (93 i A+92 B) \cot ^3(c+d x)}{60 d}-\frac {a A \cot ^6(c+d x) (a+i a \tan (c+d x))^3}{6 d}-\frac {(3 i A+2 B) \cot ^5(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{10 d}+\frac {(13 A-12 i B) \cot ^4(c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{20 d}+\frac {1}{120} \int \cot (c+d x) \left (-960 a^4 (A-i B)-960 a^4 (i A+B) \tan (c+d x)\right ) \, dx\\ &=-8 a^4 (i A+B) x-\frac {8 a^4 (i A+B) \cot (c+d x)}{d}-\frac {4 a^4 (A-i B) \cot ^2(c+d x)}{d}+\frac {a^4 (93 i A+92 B) \cot ^3(c+d x)}{60 d}-\frac {a A \cot ^6(c+d x) (a+i a \tan (c+d x))^3}{6 d}-\frac {(3 i A+2 B) \cot ^5(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{10 d}+\frac {(13 A-12 i B) \cot ^4(c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{20 d}-\left (8 a^4 (A-i B)\right ) \int \cot (c+d x) \, dx\\ &=-8 a^4 (i A+B) x-\frac {8 a^4 (i A+B) \cot (c+d x)}{d}-\frac {4 a^4 (A-i B) \cot ^2(c+d x)}{d}+\frac {a^4 (93 i A+92 B) \cot ^3(c+d x)}{60 d}-\frac {8 a^4 (A-i B) \log (\sin (c+d x))}{d}-\frac {a A \cot ^6(c+d x) (a+i a \tan (c+d x))^3}{6 d}-\frac {(3 i A+2 B) \cot ^5(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{10 d}+\frac {(13 A-12 i B) \cot ^4(c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{20 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 10.15, size = 1009, normalized size = 4.52 \[ a^4 \left (\frac {(\cot (c+d x)+i)^4 (B+A \cot (c+d x)) (A \cos (2 c)-i B \cos (2 c)-i A \sin (2 c)-B \sin (2 c)) \left (8 i \tan ^{-1}(\tan (5 c+d x)) \cos (2 c)+8 \tan ^{-1}(\tan (5 c+d x)) \sin (2 c)\right ) \sin ^5(c+d x)}{d (\cos (d x)+i \sin (d x))^4 (A \cos (c+d x)+B \sin (c+d x))}+\frac {(\cot (c+d x)+i)^4 (B+A \cot (c+d x)) (A \cos (2 c)-i B \cos (2 c)-i A \sin (2 c)-B \sin (2 c)) \left (4 i \log \left (\sin ^2(c+d x)\right ) \sin (2 c)-4 \cos (2 c) \log \left (\sin ^2(c+d x)\right )\right ) \sin ^5(c+d x)}{d (\cos (d x)+i \sin (d x))^4 (A \cos (c+d x)+B \sin (c+d x))}+\frac {x (\cot (c+d x)+i)^4 (B+A \cot (c+d x)) \left (-40 i A \cos ^4(c)-40 B \cos ^4(c)+8 A \cot (c) \cos ^4(c)-8 i B \cot (c) \cos ^4(c)-80 A \sin (c) \cos ^3(c)+80 i B \sin (c) \cos ^3(c)+80 i A \sin ^2(c) \cos ^2(c)+80 B \sin ^2(c) \cos ^2(c)+40 A \sin ^3(c) \cos (c)-40 i B \sin ^3(c) \cos (c)-8 i A \sin ^4(c)-8 B \sin ^4(c)+(A-i B) \cot (c) (8 i \sin (4 c)-8 \cos (4 c))\right ) \sin ^5(c+d x)}{(\cos (d x)+i \sin (d x))^4 (A \cos (c+d x)+B \sin (c+d x))}+\frac {(\cot (c+d x)+i)^4 (B+A \cot (c+d x)) \csc (c) \csc (c+d x) \left (\frac {1}{240} \cos (4 c)-\frac {1}{240} i \sin (4 c)\right ) (860 i A \cos (c)+790 B \cos (c)-780 i A \cos (c+2 d x)-720 B \cos (c+2 d x)-510 i A \cos (3 c+2 d x)-465 B \cos (3 c+2 d x)+366 i A \cos (3 c+4 d x)+354 B \cos (3 c+4 d x)+150 i A \cos (5 c+4 d x)+120 B \cos (5 c+4 d x)-86 i A \cos (5 c+6 d x)-79 B \cos (5 c+6 d x)-490 A \sin (c)+420 i B \sin (c)-600 i A d x \sin (c)-600 B d x \sin (c)-345 A \sin (c+2 d x)+300 i B \sin (c+2 d x)-450 i A d x \sin (c+2 d x)-450 B d x \sin (c+2 d x)+345 A \sin (3 c+2 d x)-300 i B \sin (3 c+2 d x)+450 i A d x \sin (3 c+2 d x)+450 B d x \sin (3 c+2 d x)+120 A \sin (3 c+4 d x)-90 i B \sin (3 c+4 d x)+180 i A d x \sin (3 c+4 d x)+180 B d x \sin (3 c+4 d x)-120 A \sin (5 c+4 d x)+90 i B \sin (5 c+4 d x)-180 i A d x \sin (5 c+4 d x)-180 B d x \sin (5 c+4 d x)-30 i A d x \sin (5 c+6 d x)-30 B d x \sin (5 c+6 d x)+30 i A d x \sin (7 c+6 d x)+30 B d x \sin (7 c+6 d x))}{d (\cos (d x)+i \sin (d x))^4 (A \cos (c+d x)+B \sin (c+d x))}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.71, size = 332, normalized size = 1.49 \[ \frac {4 \, {\left (30 \, {\left (9 \, A - 7 i \, B\right )} a^{4} e^{\left (10 i \, d x + 10 i \, c\right )} - 45 \, {\left (19 \, A - 17 i \, B\right )} a^{4} e^{\left (8 i \, d x + 8 i \, c\right )} + 10 \, {\left (135 \, A - 121 i \, B\right )} a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} - 15 \, {\left (75 \, A - 68 i \, B\right )} a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + 6 \, {\left (81 \, A - 74 i \, B\right )} a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} - {\left (86 \, A - 79 i \, B\right )} a^{4} - 30 \, {\left ({\left (A - i \, B\right )} a^{4} e^{\left (12 i \, d x + 12 i \, c\right )} - 6 \, {\left (A - i \, B\right )} a^{4} e^{\left (10 i \, d x + 10 i \, c\right )} + 15 \, {\left (A - i \, B\right )} a^{4} e^{\left (8 i \, d x + 8 i \, c\right )} - 20 \, {\left (A - i \, B\right )} a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} + 15 \, {\left (A - i \, B\right )} a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} - 6 \, {\left (A - i \, B\right )} a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (A - i \, B\right )} a^{4}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right )\right )}}{15 \, {\left (d e^{\left (12 i \, d x + 12 i \, c\right )} - 6 \, d e^{\left (10 i \, d x + 10 i \, c\right )} + 15 \, d e^{\left (8 i \, d x + 8 i \, c\right )} - 20 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 15 \, d e^{\left (4 i \, d x + 4 i \, c\right )} - 6 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 10.24, size = 459, normalized size = 2.06 \[ -\frac {5 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 48 i \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 12 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 240 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 120 i \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 880 i \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 620 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2835 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 2400 i \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 10080 i \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 9480 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 30720 \, {\left (A a^{4} - i \, B a^{4}\right )} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + i\right ) + 15360 \, {\left (A a^{4} - i \, B a^{4}\right )} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) - \frac {37632 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 37632 i \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 10080 i \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 9480 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 2835 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 2400 i \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 880 i \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 620 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 240 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 120 i \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 48 i \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 12 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 5 \, A a^{4}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6}}}{1920 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.50, size = 259, normalized size = 1.16 \[ -\frac {4 A \,a^{4} \left (\cot ^{2}\left (d x +c \right )\right )}{d}+\frac {7 a^{4} B \left (\cot ^{3}\left (d x +c \right )\right )}{3 d}-\frac {8 a^{4} B c}{d}-\frac {8 B \cot \left (d x +c \right ) a^{4}}{d}+\frac {7 A \,a^{4} \left (\cot ^{4}\left (d x +c \right )\right )}{4 d}-\frac {i B \,a^{4} \left (\cot ^{4}\left (d x +c \right )\right )}{d}-\frac {8 i A \cot \left (d x +c \right ) a^{4}}{d}+\frac {8 i B \,a^{4} \ln \left (\sin \left (d x +c \right )\right )}{d}+\frac {4 i B \,a^{4} \left (\cot ^{2}\left (d x +c \right )\right )}{d}+\frac {8 i A \,a^{4} \left (\cot ^{3}\left (d x +c \right )\right )}{3 d}-\frac {8 i A \,a^{4} c}{d}-\frac {4 i A \,a^{4} \left (\cot ^{5}\left (d x +c \right )\right )}{5 d}-8 i A x \,a^{4}-8 a^{4} B x -\frac {8 a^{4} A \ln \left (\sin \left (d x +c \right )\right )}{d}-\frac {A \,a^{4} \left (\cot ^{6}\left (d x +c \right )\right )}{6 d}-\frac {a^{4} B \left (\cot ^{5}\left (d x +c \right )\right )}{5 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.71, size = 171, normalized size = 0.77 \[ \frac {60 \, {\left (d x + c\right )} {\left (-8 i \, A - 8 \, B\right )} a^{4} + 240 \, {\left (A - i \, B\right )} a^{4} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 480 \, {\left (A - i \, B\right )} a^{4} \log \left (\tan \left (d x + c\right )\right ) - \frac {{\left (480 i \, A + 480 \, B\right )} a^{4} \tan \left (d x + c\right )^{5} + 240 \, {\left (A - i \, B\right )} a^{4} \tan \left (d x + c\right )^{4} + {\left (-160 i \, A - 140 \, B\right )} a^{4} \tan \left (d x + c\right )^{3} - 15 \, {\left (7 \, A - 4 i \, B\right )} a^{4} \tan \left (d x + c\right )^{2} + {\left (48 i \, A + 12 \, B\right )} a^{4} \tan \left (d x + c\right ) + 10 \, A a^{4}}{\tan \left (d x + c\right )^{6}}}{60 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 7.59, size = 162, normalized size = 0.73 \[ -\frac {{\mathrm {tan}\left (c+d\,x\right )}^4\,\left (4\,A\,a^4-B\,a^4\,4{}\mathrm {i}\right )-{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (\frac {7\,A\,a^4}{4}-B\,a^4\,1{}\mathrm {i}\right )+{\mathrm {tan}\left (c+d\,x\right )}^5\,\left (8\,B\,a^4+A\,a^4\,8{}\mathrm {i}\right )-{\mathrm {tan}\left (c+d\,x\right )}^3\,\left (\frac {7\,B\,a^4}{3}+\frac {A\,a^4\,8{}\mathrm {i}}{3}\right )+\frac {A\,a^4}{6}+\mathrm {tan}\left (c+d\,x\right )\,\left (\frac {B\,a^4}{5}+\frac {A\,a^4\,4{}\mathrm {i}}{5}\right )}{d\,{\mathrm {tan}\left (c+d\,x\right )}^6}-\frac {16\,a^4\,\mathrm {atan}\left (2\,\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (B+A\,1{}\mathrm {i}\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 4.93, size = 347, normalized size = 1.56 \[ - \frac {8 a^{4} \left (A - i B\right ) \log {\left (e^{2 i d x} - e^{- 2 i c} \right )}}{d} + \frac {344 A a^{4} - 316 i B a^{4} + \left (- 1944 A a^{4} e^{2 i c} + 1776 i B a^{4} e^{2 i c}\right ) e^{2 i d x} + \left (4500 A a^{4} e^{4 i c} - 4080 i B a^{4} e^{4 i c}\right ) e^{4 i d x} + \left (- 5400 A a^{4} e^{6 i c} + 4840 i B a^{4} e^{6 i c}\right ) e^{6 i d x} + \left (3420 A a^{4} e^{8 i c} - 3060 i B a^{4} e^{8 i c}\right ) e^{8 i d x} + \left (- 1080 A a^{4} e^{10 i c} + 840 i B a^{4} e^{10 i c}\right ) e^{10 i d x}}{- 15 d e^{12 i c} e^{12 i d x} + 90 d e^{10 i c} e^{10 i d x} - 225 d e^{8 i c} e^{8 i d x} + 300 d e^{6 i c} e^{6 i d x} - 225 d e^{4 i c} e^{4 i d x} + 90 d e^{2 i c} e^{2 i d x} - 15 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________